var pid;
function pay() {
    $.post("/index/payed", {
        id: pid
    }, function (result) {
        window.location.reload();
    })
    $('#warning-block').hide();
}

function changedState() {
    $.post("/bcdoctor/changedState", {
        id: pid
    }, function (result) {
        window.location.reload();
    })
    $('#warning-block').hide();
}

function warning(operate, payid) {
    if ("open" == operate) {
        pid = payid;
        $('#warning-block').show();
    } else {
        $('#warning-block').hide();
    }
}
function checkpasswd() {
    var oldpwd = $("#oldpasswd").val();
    var newpwd = $("#newpasswd").val();
    var renewpwd = $("#renewpasswd").val();
    if (oldpwd && newpwd && renewpwd) {
        $.post("/reset/submit", {
            oldpasswd: oldpwd,
            newpasswd: newpwd,
            renewpasswd: renewpwd
        }, function (result) {
            if (result.status == "success") {
                $('#message').text(result.message);
                $('#warning-block').show();
                setTimeout(function () {
                    window.location.reload();
                }, 1000)
            } else {
                $('#message').text(result.message);
                $('#warning-block').show();
            }
        })
    } else {
        $('#message').text("密码不能为空！");
        $('#warning-block').show();
    }
}